package com.yan.hello.config;

import com.yan.hello.BraveKnight;
import com.yan.hello.Knight;
import com.yan.hello.Quest;
import com.yan.hello.SlayDragonQuest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class KnightConfig {

    @Bean(name="knight")
    public Knight knight() {
        return new BraveKnight(quest());
    }

    @Bean(name="quest")
    public Quest quest() {
        return new SlayDragonQuest(System.out);
    }
}
